<%-- 
    Document   : crud
    Created on : 15/06/2013, 06:21:39 PM
    Author     : PabloJesus
--%>

<%@page import="java.util.List"%>
<%@page import="beans.Persona"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script src="js/script.js?1.0.1" type="text/javascript"></script>
        <script src="js/jquery.js?1.0.1" type="text/javascript"></script>
        <title>JSP Page</title>
    </head>
    <body>


        ${mensaje}<br/>
        <br/>
        <br/>        
        <h1 style="text-align: center">Lista de persona</h1> 
        <table style="margin-left: auto; margin-right: auto">
            <thead>
                <tr>
                    <th>Id</th>
                    <th>Nombres</th>
                    <th>Ap. Paterno</th>
                    <th>Ap. Materno</th>
                    <th>Editar</th>
                    <th>Eliminar</th>
                    <th>Ver más</th>
                </tr>
            </thead>
            <tbody> 
                <c:forEach var="persona" items="${lista}">
                <tr>
                    <td>${persona.id}</td>
                    <td>${persona.nombres}</td>
                    <td>${persona.apellidoPaterno}</td>
                    <td>${persona.apellidoMaterno}</td>                    
                    <td>
                        <button type="button" onclick="document.location='mantenimientoPersona.srv?registro=false&idUsuario=${persona.id}'">Editar</button>
                    </td>
                    <td>
                        <button type="button" onclick="eliminarPersona('${persona.id}')">Eliminar</button>
                    </td>
                    <td>
                        <button type="button" onclick="verDatosAdicionales('${persona.id}')">ver mas</button>
                    </td>
                </tr>
                </c:forEach>
            </tbody>
        </table>
        <br/>
        <div style="text-align: center"> 
            <button type="button" id="btnNuevo" onclick="document.location='mantenimientoPersona.srv?registro=true'">Nuevo</button>
            <button type="button" id="btnListar" onclick="document.location='crudPersona.srv'">Listar</button>
        </div>
    </body>
</html>





